package main

import "fmt"

//全局变量
var num = 100
var num2 = 200

var (
	num3 = 300
	uname = "ddddd"
)

func main() {
	fmt.Println("num =", num,"num2 =", num2,"num3 =",num3,"uname =", uname)
	//只定义不赋值，默认值为0
	var i int = 10
	fmt.Println("i =",i)

	//根据值自行判定变量类型(类型推导)
	var s = "sssss"
	fmt.Println("s =", s)

	//等价与 var name = "tom"
	name := "tom"
	fmt.Println("name =", name)

	//变量的声明 等价于 n1, name, n2 := 100, "tom", 200
	var n1, name2, n2 = 100, "tom", 888
	fmt.Println("n1 =", n1,"name2 =", name2,"n2 =",n2)
}